import 'package:flutter/material.dart';

class ItemRoundedOption extends StatelessWidget {
  final Color bgColor;
  final Color textColor;
  final Color secondTextColor;
  final String text;
  final String secondText;
  final String imagePath;
  final double imageSize;
  final EdgeInsetsGeometry margin;
  final GestureTapCallback onTap;

  const ItemRoundedOption({
    Key key,
    @required this.bgColor,
    @required this.text,
    @required this.imagePath,
    this.margin,
    this.onTap,
    this.secondText,
    this.secondTextColor,
    this.imageSize,
    this.textColor,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: onTap,
      child: Container(
        decoration: BoxDecoration(
          color: bgColor,
          borderRadius: BorderRadius.all(Radius.circular(10)),
        ),
        height: 120,
        margin: margin ?? EdgeInsets.symmetric(horizontal: 5),
        child: Center(
          child: Column(
            mainAxisSize: MainAxisSize.min,
            children: [
              Image.asset(imagePath, width: imageSize ?? 50),
              Padding(
                padding: const EdgeInsets.only(top: 8.0),
                child: Column(
                  children: [
                    Text(
                      text,
                      style: TextStyle(color: textColor ?? Colors.white),
                    ),
                    Offstage(
                      offstage: secondText == null,
                      child: Text(
                        secondText ?? '',
                        style: TextStyle(
                            color: secondTextColor ?? Colors.white,
                            fontSize: 12),
                      ),
                    ),
                  ],
                ),
              )
            ],
          ),
        ),
      ),
    );
  }
}
